package lianxiyong.test;


public class myrunnable implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i <100 ; i++) {
            try{
                Thread.sleep(300);
                System.out.println(i+" "+Thread.currentThread().getName());
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
class testrunnale{
    public static void main(String[] args) {
        myrunnable s1=new myrunnable();
        myrunnable s2=new myrunnable();
        myrunnable s3=new myrunnable();
        Thread a1 =new Thread(s1);
        Thread a2 =new Thread(s2);
        Thread a3 =new Thread(s3);
        a1.setPriority(1);
        a2.setPriority(10);
        a3.setPriority(5);
        a1.start();a2.start();a3.start();
    }
}
